<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"  
		xmlns:h="http://java.sun.com/jsf/html"  
		xmlns:f="http://java.sun.com/jsf/core"
		xmlns:ui="http://java.sun.com/jsf/facelets"
		xmlns:c="http://java.sun.com/jsp/jstl/core">  
    
    <ui:composition template="#{helperNavigation.getPathTemplate('basic')}">
        <ui:define name="pageTitle">BooXtore</ui:define>
        
        <ui:define name="mainContent">
            <h:form>
                <h:panelGrid columns="2">
                    <h:panelGrid></h:panelGrid>
                    
                    <h:panelGrid columns="1">
                        <c:if test="#{userSession.book != null}">
                            <h2>#{userSession.book.title}</h2>
                        
                            <h4>Auteur(s) : #{bookManager.getBookAuthors(userSession.book)} </h4>

                            <h:panelGrid columns="4">
                                <h4>Prix : </h4> <h:outputText value="#{userSession.book.price} €"/>
                                <h4>Stock : </h4> <h:outputText value="#{userSession.book.stock}"/>

                                <h4>Editeur : </h4> <h:outputText value="#{userSession.book.editor}" />
                                <h4>Date de publication : </h4> <h:outputText value="#{userSession.book.publicationDate}"><f:convertDateTime pattern="dd/MM/YYYY"/></h:outputText>

                                <h4>Résumé : </h4> <h:outputText value="#{userSession.book.summary}"/>
                                <h4>Sommaire :</h4> <h:outputText value="#{userSession.book.contents}"/>

                                <h:commandLink value="Ajouter au panier" action="#{cartSession.addInvoice(userSession.book, 1)}"/>

                            </h:panelGrid>
                        </c:if>
                        <c:if test="#{userSession.book == null}">
                            <div class="alert alert-block div-info">Il n'y a pas de livre à afficher.</div>
                        </c:if>
                    </h:panelGrid>
                </h:panelGrid>
            </h:form>
        </ui:define>
    </ui:composition>
</html>

